<template>
	<div class="home_m">
		<main class="m_product">
			<div class="left_share_quality_content clearfix">
				<div class="share_quality">
					<div class="share_quality_top">
						<div class="share_title">
							<p class="share_text line_height40 color_main_red">为您推荐</p>
						</div>
					</div>
					<div class="share_quality_left not_eng_box">
						<ul>
							<li class="not_eng_item" v-for="item in mainDatas">
								<router-link class="not_eng_link" :to="'/detail/'+item.Id">
									<img v-lazy="item.product_img_url" alt="" class="not_eng_pic lazy-img-fadein">
									<div class="not_eng_info">
										<p class="not_eng_title">{{item.ProductName}}</p>
										<p class="not_eng_text">
											<i style="text-decoration: none;font-style: normal;font-size: 12px">¥</i>
											<span class="more_info_price_txt">{{item.MarketPrice}}</span>
										</p>
									</div>
								</router-link>
							</li>
						</ul>
					</div>
				</div>
			</div>
		</main>
	</div>
</template>
<script>
	export default {
		data() {
			return {
				homeDatas: [],
				mainDatas: []
			}
		},
		mounted() {
			this.getData();
		},
		methods: {
			getData() {
				let _this = this;
				_this.$http.get('/Client/Products', null, localStorage.Authorization, res => {
					console.log('首页res', res)
					if(res.code === 101){
						//alert(res.error)
					}else{
						_this.homeDatas.push(res.data.list[0]);
//						_this.homeDatas.push(res.data.list[1]);
//						_this.homeDatas.push(res.data.list[2]);
//						_this.homeDatas.push(res.data.list[3]);
						_this.mainDatas = res.data.list;
					}
				})
			}
		}
	}
</script>
<style>
	img[lazy=error] {
		background: url('../assets/images/err.png');
	}
</style>